import pymysql

# 获取数据库连接
db = pymysql.connect(host='localhost', port=3306, user='root', password='123456', database='test_123', charset='utf8')

# 获取游标
cur = db.cursor()

cur.execute("insert into table1 values(3,'Boss',30,'1994-12-04 00:00:00')")
# 将修改内容提交到数据库
db.commit()
# 关闭游标
cur.close()

# 关闭数据库连接
db.close()
